<?php
# User session management
require_once('includes/user_manage.php');

	$_POST["cfm_key"]=htmlentities($_POST["cfm_key"]);
	if ($user->cfm_key==$_POST["cfm_key"]) {
		$user->cfm_key=null;
		$user->cfm();
		$_SESSION["ser_user"]=serialize($user);
		if (isset($_POST["serOrder"]) && $_POST["serOrder"]) {
			include($server->get_path_name("check_out_1.php"));
		}
		else {
			include($server->get_path_name('user_area.php'));
		}
?>
<script type="text/javascript">
document.getElementById("connectButtonBox").className = "connected";
document.getElementById("connectButton").innerHTML = "Conectado";
document.getElementById("connectStatusName").innerHTML = "<?php echo $user->firstname." ".$user->lastname ?>";
document.getElementById("disconnectText").innerHTML = "Desconectar";
document.getElementById("disconnectLink").href = "?section=disconnect";
</script>
<?php
	}
	else {
?>
<div class="note">
	La clave es incorrecta por favor vuelve a introducirla.
</div>

<?php
		include($server->get_path_name("cfmkey_form.php"));
	}
?>
